cmake_minimum_required(VERSION 3.15) 
project(app_demo)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../api_demo/cmake/modules")
find_package(api_demo REQUIRED)

message("test: api_demo_FOUND=${api_demo_FOUND}")
if(api_demo_FOUND)
    message("test: The library api_demo has been found.")
else()
    message("test: The library api_demo was not found.")
endif()

# include_directories(${api_demo_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)
target_include_directories(${PROJECT_NAME} PUBLIC ${api_demo_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${api_demo_LIBRARIES})
target_link_directories(${PROJECT_NAME} PUBLIC ${api_demo_LIBRARY_DIRS})

message("test: CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR}")
message("test: CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
message("test: get_target_property=${CMAKE_CURRENT_SOURCE_DIR}")